package com.itboye.ihomebank.adapter.jinrong;

import android.content.Context;

import com.itboye.ihomebank.R;
import com.itboye.ihomebank.bean.TouZiJiLuBean;
import com.itboye.ihomebank.support.commonadapter.MutiplyCommonAdapter;
import com.itboye.ihomebank.support.commonadapter.ViewHolder;
import com.itboye.ihomebank.util.DoubleUtil;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * 投资记录
 */
public class TouZiJiLuAdapter extends MutiplyCommonAdapter<TouZiJiLuBean.A> {
    List<TouZiJiLuBean.A> datas;
    Context context;
    int position;
    public TouZiJiLuAdapter(Context context, List<TouZiJiLuBean.A> datas, int... layoutId) {
        super(context, datas, layoutId);
        this.datas = datas;
        this.context=context;
    }

    @Override
    public int getItemViewType(int position) {
        return 0;
    }

    @Override
    public void getItemPosition(int position) {
        this.position = position;
    }

    @Override
    public void convert(ViewHolder holder, TouZiJiLuBean.A t, int type, int position) {
        holder.setText(R.id.textView1, t.getMobile());
        holder.setText(R.id.textView2, DoubleUtil.doubleTransform(t.getInvestment()));
        holder.setText(R.id.textView3, new SimpleDateFormat("yyyy-MM-dd HH:ss")
                .format(Long.parseLong(t.getCreate_time()) * 1000));
    }
}
